<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport">
		<meta name="keywords" content="浙江刑事律师,杭州刑事律师,刑事律师,刑辩律师,浙江刑事辩护律师,浙江刑辩律师,杭州刑事辩护律师,杭州刑辩律师" />
		<meta name="description" content="刑辩是法治的风向标。民主盛行、法治完备，刑辩才有其应有的地位和作用。同时，也只有刑辩专业化达到一定水准，才能取得执政党和人民群众的认可，获得应有的地位。靖霖律师将努力践行刑辩专业化的道路，打造一支刑辩" />
		<title>靖霖(宁波)律师事务所 - 浙江刑事律师,杭州刑事律师,浙江刑辩律师 - 律师团队</title>
		<link href="lvshi/iconfont/iconfont.css" rel="stylesheet" type="text/css" />
		<link rel="stylesheet" href="lvshi/css/swiper.min.css">
		<link rel="stylesheet" type="text/css" href="lvshi/css/common.css"/>
	</head>
	<body>
		<header>
			<img class="logo" src="img/logo.png" alt="">
			<span class="return">
				<img src="lvshi/img/return.png">
				返回
			</span>
		</header>
		<div class="main">
			<div class="swiper-container filter">
				<div class="swiper-wrapper">
					<div class="swiper-slide filter-item">全部</div>
					<div class="swiper-slide filter-item">公司犯罪</div>
					<div class="swiper-slide filter-item">海事犯罪</div>
					<div class="swiper-slide filter-item">职务犯罪</div>
					<div class="swiper-slide filter-item">金融犯罪</div>
					<div class="swiper-slide filter-item">毒品犯罪</div>
					<div class="swiper-slide filter-item">网络犯罪</div>
					<div class="swiper-slide filter-item">走私犯罪</div>

				</div>
			</div>
			<ul class="case-list list" id="list_content">

			</ul>
			<div style="text-align: center;line-height: 50px;">
				<img style="display: none;" class="loading" src="lvshi/img/loading.gif" style="width: 20px;" alt="">
				<div class="showMore" style="color: #006699;font-size: 12px;display: none;">点击加载更多>></div>
			</div>
		</div>


		<script type="text/javascript" src="lvshi/js/jquery.min.js"></script>
		<script type="text/javascript" src="lvshi/js/swiper.min.js"></script>
		<script type="text/javascript" src="lvshi/js/common.js"></script>
		<script type="text/javascript">
			var swiper = new Swiper('.swiper-container', {
				slidesPerView: 4.5,
				slidesPerGroup: 4
			});
		
			var params = {
				layerName: '', //姓名
				limit: 2, //记录数
				offset: 1 //页码
			};
			$(document).ready(function() {
				params.layerName = decodeURI(getQueryString("name"));
				if(getQueryString("expert")){
					params.expert = decodeURI(getQueryString("expert"));
					$(".swiper-slide").each(function() {
						if($(this).html() == params.expert) {
							$(this).addClass("filter-item-active");
							/*var index = $(this).index();
							swiper.params.initialSlide = index;*/
							var w = $(this).width(),index = $(this).index();
							if(index >= 4 && index <= $('.filter-item').length - 4){
								$('.swiper-wrapper').css({'transform': 'translate3d(-'+ w * index +'px, 0px, 0px)'})
							} else if(index > $('.filter-item').length - 4){
								$('.swiper-wrapper').css({'transform': 'translate3d(-'+ w * ($('.filter-item').length - 4) +'px, 0px, 0px)'})
							}
							
						}
					});
				} else {
					$('.filter-item').eq(0).addClass('filter-item-active')
				}
				
					
				search(); //搜索

				$('.showMore').click(function(){
					if($(this).html() == '没有更多数据了...'){
						return false;
					}
					var page = params.offset;
					page++;
					params.offset = page;
					search();
				})
			});
			//查询方法
			function search() {
				if(params.offset == 1){
					$('#list_content').html('');
				}
				
				$('.loading').show();
				$('.showMore').hide().html('点击加载更多>>').css({'color':'#006699'});
				setTimeout(function(){
					$.ajax({
						url: 'content/list',
						type: 'get',
						data: params,
						dataType: "json",
						success: function(data) {
							$('.loading').hide();
							$('.showMore').show();
							var contentHtml = "";
							console.log(data.rows.length < params.limit)
							
							if(data.page > data.totalPages){
								$('.showMore').html('没有更多数据了...').css({'color':'#999'});
								return false;
							}
							if(data.rows) {
								
								if(data.rows.length < params.limit){
									$('.showMore').html('没有更多数据了...').css({'color':'#999'});
								}
								for(var i = 0; i < data.rows.length; i++) {
									var obj = data.rows[i];
									var imgHtml = "<span class='noImg'>暂无图片</span>";
									if(obj.image) {
										imgHtml = "<img src='" + obj.image + "'/>";
									}
								contentHtml += "<li data-id = '" + obj.id + "'>" + imgHtml + "<div><div class='case-title'>" + obj.title + "</div><div class='case-info'><div><span>律师："+obj.layerName+"</span><span style='float:right;'>领域："+obj.expert+"</span></div><span>时间："+obj.crtTime+"</span></div></div></li>";
			
								}
								$("#list_content").append(contentHtml);
								initCaseList();
							}
						}
					});
				},2000)
			}
		</script>
	</body>
</html>
